#pragma once

#include <memory>

#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLineEdit>
#include <QPushButton>
#include <QLabel>
#include <QTimer>

class CountdownWidget : public QWidget
{
    Q_OBJECT

public:
    CountdownWidget(int secdonds);
    CountdownWidget(std::shared_ptr<QWidget> parent, int secdonds);
    CountdownWidget(QWidget* parent, int secdonds);
    ~CountdownWidget();
    void ResetCounter(int secdonds);
    void RestartCounter();

private slots:
    void startCountdown();
    void updateCountdown();

private:
    std::shared_ptr<QLineEdit> inputEdit;
    std::shared_ptr<QPushButton> startButton;
    std::shared_ptr<QLabel> countdownLabel;
    std::shared_ptr<QTimer> countdownTimer;

    std::shared_ptr<QVBoxLayout> mainLayout;
    std::shared_ptr<QHBoxLayout> inputLayout;

    int remainingSeconds;
};